/**
 * Copyright (c) 2014, 2017, Oracle and/or its affiliates.
 * The Universal Permissive License (UPL), Version 1.0
 */
"use strict";
/*
 Copyright 2013 jQuery Foundation and other contributors
 Released under the MIT license.
 http://jquery.org/license
 Copyright 2013 jQuery Foundation and other contributors
 Released under the MIT license.
 http://jquery.org/license
*/
define(["ojs/ojcore","jquery","ojs/ojcomponentcore","ojs/ojpopupcore","ojs/ojbutton","jqueryui-amd/widgets/draggable","jqueryui-amd/widgets/mouse"],function(a,g){(function(){a.Ra("oj.ojResizable",g.oj.baseComponent,{version:"1.0.0",widgetEventPrefix:"oj",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",containment:!1,ghost:!1,grid:!1,handles:"e,s,se",
helper:!1,resize:null,start:null,stop:null},HV:function(a){return parseInt(a,10)||0},Mg:function(a){return!isNaN(parseInt(a,10))},V9:function(a,c){if("hidden"===g(a).css("overflow"))return!1;var d=c&&"left"===c?"scrollLeft":"scrollTop",e=!1;if(0<a[d])return!0;a[d]=1;e=0<a[d];a[d]=0;return e},_ComponentCreate:function(){this._super();var a,c,d,e,f,h=this;a=this.options;c=this.element.mouse.bind(this.element);c();this.zr=c("instance");this.zr._mouseCapture=function(a){this.element&&this.element.focus();
return h.xAa(a)};this.zr._mouseStart=function(a){return h.AAa(a)};this.zr._mouseDrag=function(a){return h.yAa(a)};this.zr._mouseStop=function(a){return h.$D(a)};this.element.addClass("oj-resizable");g.extend(this,{$N:this.element,XK:[],Po:null});this.handles=a.handles||(g(".oj-resizable-handle",this.element).length?{aOa:".oj-resizable-n",KNa:".oj-resizable-e",gOa:".oj-resizable-s",Ei:".oj-resizable-w",hOa:".oj-resizable-se",jOa:".oj-resizable-sw",bOa:".oj-resizable-ne",cOa:".oj-resizable-nw"}:"e,s,se");
if(this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),a=this.handles.split(","),this.handles={},c=0;c<a.length;c++)d=g.trim(a[c]),f="oj-resizable-"+d,e=g("\x3cdiv class\x3d'oj-resizable-handle "+f+"'\x3e\x3c/div\x3e"),this.handles[d]=".oj-resizable-"+d,this.element.append(e);this.MCa=function(){for(var a in this.handles)this.handles[a].constructor===String&&(this.handles[a]=this.element.children(this.handles[a]).first().show())};this.MCa();this.mya=g(".oj-resizable-handle",
this.element);this.mya.mouseover(function(){h.Ija||(this.className&&(e=this.className.match(/oj-resizable-(se|sw|ne|nw|n|e|s|w)/i)),h.axis=e&&e[1]?e[1]:"se")});this.zr._mouseInit()},_destroy:function(){this.zr&&this.zr._mouseDestroy();try{this.zr.destroy(),this.zr=null}catch(a){}g(this.$N).removeClass("oj-resizable oj-resizable-disabled oj-resizable-resizing").removeData("resizable").removeData("oj-resizable").unbind(".resizable").find(".oj-resizable-handle").remove();return this},xAa:function(a){var c,
d,e=!1;for(c in this.handles)if(d=g(this.handles[c])[0],d===a.target||g.contains(d,a.target))e=!0;return!this.options.disabled&&e},AAa:function(a){var c,d,e;e=this.options;c=this.element.position();var f=this.element;this.Ija=!0;/absolute/.test(f.css("position"))?f.css({position:"absolute",top:f.css("top"),left:f.css("left")}):f.is(".oj-draggable")&&f.css({position:"absolute",top:c.top,left:c.left});this.NCa();c=this.HV(this.helper.css("left"));d=this.HV(this.helper.css("top"));e.containment&&(c+=
g(e.containment).scrollLeft()||0,d+=g(e.containment).scrollTop()||0);this.offset=this.helper.offset();this.position={left:c,top:d};this.size={width:f.width(),height:f.height()};this.Un={width:f.width(),height:f.height()};this.au={left:c,top:d};this.oO={width:f.outerWidth()-f.width(),height:f.outerHeight()-f.height()};this.yKa={left:a.pageX,top:a.pageY};this.kp=this.Un.width/this.Un.height||1;e=g(".oj-resizable-"+this.axis).css("cursor");g("body").css("cursor","auto"===e?this.axis+"-resize":e);f.addClass("oj-resizable-resizing");
this.aW("start",a);this.Upa(a);this.Era(a);return!0},yAa:function(a){var c,d=this.helper,e={},f=this.yKa;c=a.pageX-f.left||0;var f=a.pageY-f.top||0,h=this.Mk[this.axis];this.bB={top:this.position.top,left:this.position.left};this.cB={width:this.size.width,height:this.size.height};if(!h)return!1;c=h.apply(this,[a,c,f]);this.OFa(a.shiftKey);a.shiftKey&&(c=this.MFa(c,a));c=this.ZCa(c,a);this.BFa(c);this.aW("resize",a);this.Tpa(a,this.ui());this.Dra(a,this.ui());this.position.top!==this.bB.top&&(e.top=
this.position.top+"px");this.position.left!==this.bB.left&&(e.left=this.position.left+"px");this.size.width!==this.cB.width&&(e.width=this.size.width+"px");this.size.height!==this.cB.height&&(e.height=this.size.height+"px");d.css(e);!this.Po&&this.XK.length&&this.GBa();g.isEmptyObject(e)||this._trigger("resize",a,this.ui());return!1},$D:function(a){this.Ija=!1;g("body").css("cursor","auto");this.element.removeClass("oj-resizable-resizing");this.aW("stop",a);this.Vpa(a);this.Fra(a);return!1},OFa:function(a){var c,
d,e,f;f=this.options;f={minWidth:this.Mg(f.minWidth)?f.minWidth:0,maxWidth:this.Mg(f.maxWidth)?f.maxWidth:Infinity,minHeight:this.Mg(f.minHeight)?f.minHeight:0,maxHeight:this.Mg(f.maxHeight)?f.maxHeight:Infinity};a&&(a=f.minHeight*this.kp,d=f.minWidth/this.kp,c=f.maxHeight*this.kp,e=f.maxWidth/this.kp,a>f.minWidth&&(f.minWidth=a),d>f.minHeight&&(f.minHeight=d),c<f.maxWidth&&(f.maxWidth=c),e<f.maxHeight&&(f.maxHeight=e));this.RFa=f},BFa:function(a){this.offset=this.helper.offset();this.Mg(a.left)&&
(this.position.left=a.left);this.Mg(a.top)&&(this.position.top=a.top);this.Mg(a.height)&&(this.size.height=a.height);this.Mg(a.width)&&(this.size.width=a.width)},MFa:function(a){var c=this.position,d=this.size,e=this.axis;this.Mg(a.height)?a.width=a.height*this.kp:this.Mg(a.width)&&(a.height=a.width/this.kp);"sw"===e&&(a.left=c.left+(d.width-a.width),a.top=null);"nw"===e&&(a.top=c.top+(d.height-a.height),a.left=c.left+(d.width-a.width));return a},ZCa:function(a){var c=this.RFa,d=this.axis,e=this.Mg(a.width)&&
c.maxWidth&&c.maxWidth<a.width,f=this.Mg(a.height)&&c.maxHeight&&c.maxHeight<a.height,g=this.Mg(a.width)&&c.minWidth&&c.minWidth>a.width,k=this.Mg(a.height)&&c.minHeight&&c.minHeight>a.height,l=this.au.left+this.Un.width,m=this.position.top+this.size.height,r=/sw|nw|w/.test(d),d=/nw|ne|n/.test(d);g&&(a.width=c.minWidth);k&&(a.height=c.minHeight);e&&(a.width=c.maxWidth);f&&(a.height=c.maxHeight);g&&r&&(a.left=l-c.minWidth);e&&r&&(a.left=l-c.maxWidth);k&&d&&(a.top=m-c.minHeight);f&&d&&(a.top=m-c.maxHeight);
a.width||a.height||a.left||!a.top?a.width||a.height||a.top||!a.left||(a.left=null):a.top=null;return a},GBa:function(){if(this.XK.length){var a,c,d,e,f,g=this.helper||this.element;for(a=0;a<this.XK.length;a++){f=this.XK[a];if(!this.$z)for(this.$z=[],d=[f.css("borderTopWidth"),f.css("borderRightWidth"),f.css("borderBottomWidth"),f.css("borderLeftWidth")],e=[f.css("paddingTop"),f.css("paddingRight"),f.css("paddingBottom"),f.css("paddingLeft")],c=0;c<d.length;c++)this.$z[c]=(parseInt(d[c],10)||0)+(parseInt(e[c],
10)||0);f.css({height:g.height()-this.$z[0]-this.$z[2]||0,width:g.width()-this.$z[1]-this.$z[3]||0})}}},NCa:function(){this.element.offset();this.helper=this.element},Mk:{e:function(a,c){return{width:this.Un.width+c}},w:function(a,c){return{left:this.au.left+c,width:this.Un.width-c}},n:function(a,c,d){return{top:this.au.top+d,height:this.Un.height-d}},s:function(a,c,d){return{height:this.Un.height+d}},se:function(a,c,d){return g.extend(this.Mk.s.apply(this,arguments),this.Mk.e.apply(this,[a,c,d]))},
sw:function(a,c,d){return g.extend(this.Mk.s.apply(this,arguments),this.Mk.w.apply(this,[a,c,d]))},ne:function(a,c,d){return g.extend(this.Mk.n.apply(this,arguments),this.Mk.e.apply(this,[a,c,d]))},nw:function(a,c,d){return g.extend(this.Mk.n.apply(this,arguments),this.Mk.w.apply(this,[a,c,d]))}},aW:function(a,c){"resize"!==a&&this._trigger(a,c,this.ui())},Upa:function(){function a(b){g(b).each(function(){var a=g(this);a.data("oj-resizable-alsoresize",{width:parseInt(a.width(),10),height:parseInt(a.height(),
10),left:parseInt(a.css("left"),10),top:parseInt(a.css("top"),10)})})}var c=this.options;"object"!==typeof c.alsoResize||c.alsoResize.parentNode?a(c.alsoResize):c.alsoResize.length?(c.alsoResize=c.alsoResize[0],a(c.alsoResize)):g.each(c.alsoResize,function(c){a(c)})},Tpa:function(a,c){function d(a,b){g(a).each(function(){var a=g(this),d=g(this).data("oj-resizable-alsoresize"),e={};g.each(b&&b.length?b:a.parents(c.$N[0]).length?["width","height"]:["width","height","top","left"],function(a,b){var c=
(d[b]||0)+(k[b]||0);c&&0<=c&&(e[b]=c||null)});a.css(e)})}var e=this.options,f=this.Un,h=this.au,k={height:this.size.height-f.height||0,width:this.size.width-f.width||0,top:this.position.top-h.top||0,left:this.position.left-h.left||0};"object"!==typeof e.alsoResize||e.alsoResize.nodeType?d(e.alsoResize,null):g.each(e.alsoResize,function(a,b){d(a,b)})},Vpa:function(){g(this).removeData("oj-resizable-alsoresize")},Era:function(){var a,c,d,e,f,h=this,k=h.element;d=h.options.containment;if(k=d instanceof
g?d.get(0):/parent/.test(d)?k.parent().get(0):d)h.oM=g(k),/document/.test(d)||d===document?(h.pM={left:0,top:0},h.qfa={left:0,top:0},h.cu={element:g(document),left:0,top:0,width:g(document).width(),height:g(document).height()||document.body.parentNode.scrollHeight}):(a=g(k),c=[],g(["Top","Right","Left","Bottom"]).each(function(d,e){c[d]=h.HV(a.css("padding"+e))}),h.pM=a.offset(),h.qfa=a.position(),h.rfa={height:a.innerHeight()-c[3],width:a.innerWidth()-c[1]},d=h.pM,e=h.rfa.height,f=h.rfa.width,f=
h.V9(k,"left")?k.scrollWidth:f,e=h.V9(k)?k.scrollHeight:e,h.cu={element:k,left:d.left,top:d.top,width:f,height:e})},Dra:function(a,c){var d,e,f,g;d=this.options;e=this.pM;g=this.position;var k=a.shiftKey;f={top:0,left:0};var l=this.oM,m=!0;l[0]!==document&&/static/.test(l.css("position"))&&(f=e);g.left<(this.Po?e.left:0)&&(this.size.width+=this.Po?this.position.left-e.left:this.position.left-f.left,k&&(this.size.height=this.size.width/this.kp,m=!1),this.position.left=d.helper?e.left:0);g.top<(this.Po?
e.top:0)&&(this.size.height+=this.Po?this.position.top-e.top:this.position.top,k&&(this.size.width=this.size.height*this.kp,m=!1),this.position.top=this.Po?e.top:0);this.offset.left=this.cu.left+this.position.left;this.offset.top=this.cu.top+this.position.top;d=Math.abs((this.Po?this.offset.left-f.left:this.offset.left-e.left)+this.oO.width);e=Math.abs((this.Po?this.offset.top-f.top:this.offset.top-e.top)+this.oO.height);f=this.oM.get(0)===this.element.parent().get(0);g=/relative|absolute/.test(this.oM.css("position"));
f&&g&&(d-=Math.abs(this.cu.left));d+this.size.width>=this.cu.width&&(this.size.width=this.cu.width-d,k&&(this.size.height=this.size.width/this.kp,m=!1));e+this.size.height>=this.cu.height&&(this.size.height=this.cu.height-e,k&&(this.size.width=this.size.height*this.kp,m=!1));m||(this.position.left=c.bB.left,this.position.top=c.bB.top,this.size.width=c.cB.width,this.size.height=c.cB.height)},Fra:function(){var a=this.options,c=this.pM,d=this.qfa,e=this.oM,f=g(this.helper),h=f.offset(),k=f.outerWidth()-
this.oO.width,f=f.outerHeight()-this.oO.height;this.Po&&!a.animate&&/relative/.test(e.css("position"))&&g(this).css({left:h.left-d.left-c.left,width:k,height:f});this.Po&&!a.animate&&/static/.test(e.css("position"))&&g(this).css({left:h.left-d.left-c.left,width:k,height:f})},ui:function(){return{$N:this.$N,element:this.element,helper:this.helper,position:this.position,size:this.size,Un:this.Un,au:this.au,cB:this.cB,bB:this.bB}}})})();(function(){a.Ra("oj.ojDialog",g.oj.baseComponent,{version:"1.0.0",
widgetEventPrefix:"oj",options:{cancelBehavior:"icon",dragAffordance:"title-bar",initialVisibility:"hide",modality:"modal",position:{my:"center",at:"center",of:window,collision:"fit",nOa:function(a){var c=g(this).css(a).offset().top;0>c&&g(this).css("top",a.top-c)}},resizeBehavior:"resizable",role:"dialog",title:null,beforeClose:null,beforeOpen:null,close:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},_ComponentCreate:function(){this._super();this.xKa={display:this.element[0].style.display,
width:this.element[0].style.width,height:this.element[0].style.height};this.au={parent:this.element.parent(),index:this.element.parent().children().index(this.element)};this.i_=this.element.attr("title");this.options.title=this.options.title||this.i_;this.Bsa();this.element.show().removeAttr("title").addClass("oj-dialog-content oj-dialog-default-content").appendTo(this.mc);this.CG=!1;if(this.element.find(".oj-dialog").length){var a=this;this.element.find(".oj-dialog-header").each(function(c,d){var e=
g(d);if(!e.closest(".oj-dialog-body").length)return a.qt=e,a.CG=!0,!1})}else this.qt=this.element.find(".oj-dialog-header"),this.qt.length&&(this.CG=!0);this.CG?(this.osa(this.qt),this.qt.prependTo(this.mc),this.rt=this.qt.find(".oj-dialog-title"),"icon"===this.options.cancelBehavior&&(this.BI(this.qt),this.rt.length&&this.rt.insertAfter(this.op)),this.rt.length&&(this.rt.uniqueId(),this.mc.attr({"aria-labelledby":this.rt.attr("id")}))):this.zsa();this.Or=this.element.children(".oj-dialog-footer");
this.nsa(this.Or);this.Or.length&&(this.Or.addClass("oj-helper-clearfix"),this.Or.appendTo(this.mc));"title-bar"===this.options.dragAffordance&&g.fn.draggable&&this.rz();this.rEa(this.mc);this.Ws=!1},z1:function(){"show"===this.options.initialVisibility&&this.open()},_destroy:function(){this.Lsa&&window.clearTimeout(this.Lsa);this.isOpen()&&this.hv();this.Oq&&(this.Oq("instance")&&this.Oq("destroy"),this.Oq=null);this.Or.length&&(this.Or.removeClass("oj-helper-clearfix"),g("#"+this.gba).replaceWith(this.Or));
this.KI();if(this.CG){var a=this.mc.find(".oj-dialog-header");a&&g("#"+this.hba).replaceWith(a)}this.Eka&&(this.Eka.remove(),this.Eka=null);this.element.removeUniqueId().removeClass("oj-dialog-content oj-dialog-default-content").css(this.xKa);this.mc&&this.mc.stop(!0,!0);this.element.unwrap();this.i_&&this.element.attr("title",this.i_);this.Pr&&(this.Pr.remove(),this.Pr=null);delete this.wn;delete this.Ws;this._super()},widget:function(){return this.mc},disable:g.noop,enable:g.noop,close:function(b){if(this.isOpen()&&
(!1!==this._trigger("beforeClose",b)||this.ED)){this.Ws=!1;this.cua=null;this.opener.filter(":focusable").focus().length||g(this.document[0].activeElement).blur();var c={};c[a.U.qb.Ih]=this.mc;a.U.Qe().close(c);this._trigger("close",b)}},isOpen:function(){return this.Ws},open:function(b){if(!1!==this._trigger("beforeOpen",b)){if(!this.isOpen()){this.Ws=!0;this.opener=g(this.document[0].activeElement);"resizable"===this.options.resizeBehavior&&this.zaa();b="rtl"===this.nd();b=a.Ed.ml(this.options.position,
b);var c={};c[a.U.qb.Ih]=this.mc;c[a.U.qb.zB]=this.opener;c[a.U.qb.DB]=b;c[a.U.qb.Ak]=this.options.modality;c[a.U.qb.vu]=this.Vy();c[a.U.qb.Ur]="oj-dialog-layer";c[a.U.qb.Tr]=a.U.Tr.AP;a.U.Qe().open(c);this._trigger("open")}this.q7()}},refresh:function(){this._super()},q7:function(){var b=this.cua;b&&0<b.length&&a.D.Gt(this.mc[0],b[0])||(b||(b=this.element.find("[autofocus]")),b.length||(b=this.element.find(":tabbable")),b.length||this.Or.length&&(b=this.Or.find(":tabbable")),b.length||this.op&&(b=
this.op.filter(":focusable")),b.length||(b=this.mc),b.eq(0).focus(),this._trigger("focus"))},_keepFocus:function(a){a.preventDefault();a=this.document[0].activeElement;this.mc[0]===a||g.contains(this.mc[0],a)||this.q7()},Mg:function(a){return!isNaN(parseInt(a,10))},Bsa:function(){this.baa=!1;this.element.uniqueId();this.LS=this.element.attr("id");this.oe?(this.mc=g(this.oe),this.mc.uniqueId(),this.Lea=this.mc.attr("id")):(this.Lea="ojDialogWrapper-"+this.LS,this.mc=g("\x3cdiv\x3e"),this.mc.insertBefore(this.element));
this.mc.addClass("oj-dialog oj-component").hide().attr({tabIndex:-1,role:this.options.role,id:this.Lea});this._on(this.mc,{keyup:function(){},keydown:function(a){if("none"!=this.options.cancelBehavior&&!a.isDefaultPrevented()&&a.keyCode&&a.keyCode===g.ui.keyCode.ESCAPE)a.preventDefault(),a.stopImmediatePropagation(),this.close(a);else if(a.keyCode===g.ui.keyCode.TAB){var c=this.mc.find(":tabbable"),d=c.filter(":first"),e=c.filter(":last");a.shiftKey?a.shiftKey&&(a.target===d[0]||a.target===this.mc[0]?
(e.focus(),a.preventDefault()):(d=c.index(document.activeElement),1==d&&c[0]&&(c[0].focus(),a.preventDefault()))):a.target===e[0]||a.target===this.mc[0]?(d.focus(),a.preventDefault()):(d=c.index(document.activeElement),0==d&&c[1]&&(c[1].focus(),a.preventDefault()))}}});this.element.find("[aria-describedby]").length||this.mc.attr({"aria-describedby":this.element.uniqueId().attr("id")})},rEa:function(a){var c=this;this._focusable({applyHighlight:!0,setupHandlers:function(d,e){c._on(a,{focus:function(a){d(g(a.currentTarget))},
blur:function(a){e(g(a.currentTarget))}})}})},KI:function(){this.op&&(this.op.remove(),this.op=null)},BI:function(a){this.op=g("\x3cbutton id\x3d'dialogCloseButton'\x3e\x3c\button\x3e").addClass("oj-dialog-header-close-wrapper");this.op.ojButton({display:"icons",chroming:"half",label:"close",icons:{start:"oj-component-icon oj-fwk-icon-cross"}}).attr("tabindex","1").appendTo(a);this._on(this.op,{click:function(a){a.preventDefault();a.stopImmediatePropagation();this.close(a)},keydown:function(a){if(a.keyCode&&
a.keyCode===g.ui.keyCode.SPACE||a.keyCode===g.ui.keyCode.ENTER)a.preventDefault(),a.stopImmediatePropagation(),this.close(a)}})},zsa:function(){var a;this.Pr=g("\x3cdiv\x3e").addClass("oj-dialog-header oj-helper-clearfix").prependTo(this.mc);this._on(this.Pr,{mousedown:function(a){g(a.target);a=g(a.target).parent().parent();var b=!1;a&&(b=a.hasClass("oj-dialog-header-close-wrapper"));b||this.mc.focus()}});"icon"===this.options.cancelBehavior&&this.BI(this.Pr);a=g("\x3cspan\x3e").uniqueId().addClass("oj-dialog-title").appendTo(this.Pr);
this.Qz(a);this.mc.attr({"aria-labelledby":a.attr("id")})},Qz:function(a){this.options.title||a.html("\x26#160;");a.text(this.options.title)},rz:function(){function a(b){return{position:b.position,offset:b.offset}}var c=this,d=this.options;this.mc.draggable({BNa:!1,cancel:".oj-dialog-content, .oj-dialog-header-close",handle:".oj-dialog-header",containment:"document",start:function(d,f){g(this).addClass("oj-dialog-dragging");c.kE();c._trigger("dragStart",d,a(f))},drag:function(d,f){c.kE();c._trigger("drag",
d,a(f))},stop:function(e,f){var h=f.offset.left-c.document.scrollLeft(),k=f.offset.top-c.document.scrollTop();d.position={my:"left top",at:"left"+(0<=h?"+":"")+h+" top"+(0<=k?"+":"")+k,of:window};g(this).removeClass("oj-dialog-dragging");c.kE();c._trigger("dragStop",e,a(f))}});this.mc.addClass("oj-draggable")},zaa:function(){function a(b){return{originalPosition:b.au,originalSize:b.Un,position:b.position,size:b.size}}var c=this;this.mc.css("position");this.Oq=this.mc.ojResizable.bind(this.mc);this.Oq({cancel:".oj-dialog-content",
containment:"document",handles:"n,e,s,w,se,sw,ne,nw",start:function(d,e){c.baa=!0;g(this).addClass("oj-dialog-resizing");c._trigger("resizeStart",d,a(e))},resize:function(d,e){c._trigger("resize",d,a(e))},stop:function(d,e){c.baa=!1;g(this).removeClass("oj-dialog-resizing");c._trigger("resizeStop",d,a(e))}})},SV:function(){var b="rtl"===this.nd(),b=a.Ed.ml(this.options.position,b);this.mc.position(b);this.kE()},kE:function(){a.U.Qe().wO(this.mc,a.U.Dd.$p)},_setOption:function(b,c,d){var e;e=this.mc;
if("disabled"!==b)switch(this._super(b,c,d),b){case "dragAffordance":(b=e.hasClass("oj-draggable"))&&"none"===c&&(e.draggable("destroy"),this.mc.removeClass("oj-draggable"));b||"title-bar"!==c||this.rz();break;case "position":this.SV();break;case "resizeBehavior":e=!1;this.Oq&&(e=!0);e&&"resizable"!=c&&(this.Oq("instance")&&this.Oq("destroy"),this.Oq=null);e||"resizable"!==c||this.zaa();break;case "title":this.Qz(this.Pr.find(".oj-dialog-title"));break;case "role":e.attr("role",c);break;case "modality":this.isOpen()&&
(e={},e[a.U.qb.Ih]=this.mc,e[a.U.qb.Ak]=c,a.U.Qe().aA(e));break;case "cancelBehavior":"none"===c||"escape"===c?this.KI():"icon"===c&&(this.CG?(this.KI(),this.BI(this.qt),this.rt=this.qt.find(".oj-dialog-title"),this.rt.length&&this.rt.insertAfter(this.op)):(this.KI(),this.BI(this.Pr),this.jka=this.Pr.find(".oj-dialog-title"),this.jka.length&&this.jka.insertAfter(this.op)))}},nsa:function(a){this.gba="ojDialogPlaceHolderFooter-"+this.LS;this.jBa=g("\x3cdiv\x3e").hide().attr({id:this.gba});this.jBa.insertBefore(a)},
osa:function(a){this.hba="ojDialogPlaceHolderHeader-"+this.LS;this.kBa=g("\x3cdiv\x3e").hide().attr({id:this.hba});this.kBa.insertBefore(a)},getNodeBySubId:function(a){if(null==a)return this.element?this.element[0]:null;a=a.subId;switch(a){case "oj-dialog-header":case "oj-dialog-body":case "oj-dialog-footer":case "oj-dialog-content":case "oj-dialog-header-close-wrapper":case "oj-resizable-n":case "oj-resizable-e":case "oj-resizable-s":case "oj-resizable-w":case "oj-resizable-se":case "oj-resizable-sw":case "oj-resizable-ne":case "oj-resizable-nw":a=
"."+a;if(!this.widget().find(a))break;return this.widget().find(a)[0]}return null},getSubIdByNode:function(a){if(null!=a){a=g(a);if(a.hasClass("oj-dialog-header"))return{subId:"oj-dialog-header"};if(a.hasClass("oj-dialog-footer"))return{subId:"oj-dialog-footer"};if(a.hasClass("oj-dialog-content"))return{subId:"oj-dialog-content"};if(a.hasClass("oj-dialog-header-close-wrapper"))return{subId:"oj-dialog-header-close-wrapper"};if(a.hasClass("oj-resizable-n"))return{subId:"oj-resizable-n"};if(a.hasClass("oj-resizable-e"))return{subId:"oj-resizable-e"};
if(a.hasClass("oj-resizable-s"))return{subId:"oj-resizable-s"};if(a.hasClass("oj-resizable-w"))return{subId:"oj-resizable-w"};if(a.hasClass("oj-resizable-se"))return{subId:"oj-resizable-se"};if(a.hasClass("oj-resizable-sw"))return{subId:"oj-resizable-sw"};if(a.hasClass("oj-resizable-ne"))return{subId:"oj-resizable-ne"};if(a.hasClass("oj-resizable-nw"))return{subId:"oj-resizable-nw"}}return null},tw:function(){this.element.remove()},Vy:function(){if(!this.wn){var b=this.wn={};b[a.U.Dd.Ix]=g.proxy(this.hv,
this);b[a.U.Dd.Jx]=g.proxy(this.tw,this);b[a.U.Dd.$p]=g.proxy(this.kE,this)}return this.wn},hv:function(){this.ED=!0;this.close();delete this.ED}});a.Components.Wn({ojDialog:{resizeBehavior:a.Components.Ne(function(){return(a.Wc.De("oj-dialog-option-defaults")||{}).resizeBehavior}),cancelBehavior:a.Components.Ne(function(){return(a.Wc.De("oj-dialog-option-defaults")||{}).cancelBehavior}),dragAffordance:a.Components.Ne(function(){return(a.Wc.De("oj-dialog-option-defaults")||{}).dragAffordance})}})})();
a.Components.Xa("ojDialog","baseComponent",{properties:{cancelBehavior:{type:"string"},dragAffordance:{type:"string"},initialVisibility:{type:"string"},modality:{type:"string"},position:{type:"Object"},resizeBehavior:{type:"string"},role:{type:"string"},title:{type:"string"},widget:{}},methods:{close:{},destroy:{},isOpen:{},open:{},refresh:{}},extension:{_hasWrapper:!0,_innerElement:"div",_widgetName:"ojDialog"}});a.Components.register("oj-dialog",a.Components.getMetadata("ojDialog"))});